Optimal. Leaf size=149 \[ a^2 x+\frac {5 b^2 x}{2}-\frac {2 a b \cos (c+d x)}{d}-\frac {4 a b \sec (c+d x)}{d}+\frac {2 a b \sec ^3(c+d x)}{3 d}-\frac {a^2 \tan (c+d x)}{d}-\frac {5 b^2 \tan (c+d x)}{2 d}+\frac {a^2 \tan ^3(c+d x)}{3 d}+\frac {5 b^2 \tan ^3(c+d x)}{6 d}-\frac {b^2 \sin ^2(c+d x) \tan ^3(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 149, normalized size of antiderivative = 1.00, number of steps
used = 13, number of rules used = 9, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {2801, 3554, 8,
2670, 276, 2671, 294, 308, 209} \begin {gather*} \frac {a^2 \tan ^3(c+d x)}{3 d}-\frac {a^2 \tan (c+d x)}{d}+a^2 x-\frac {2 a b \cos (c+d x)}{d}+\frac {2 a b \sec ^3(c+d x)}{3 d}-\frac {4 a b \sec (c+d x)}{d}+\frac {5 b^2 \tan ^3(c+d x)}{6 d}-\frac {5 b^2 \tan (c+d x)}{2 d}-\frac {b^2 \sin ^2(c+d x) \tan ^3(c+d x)}{2 d}+\frac {5 b^2 x}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 209
Rule 276
Rule 294
Rule 308
Rule 2670
Rule 2671
Rule 2801
Rule 3554
Rubi steps
\begin {align*} \int (a+b \sin (c+d x))^2 \tan ^4(c+d x) \, dx &=\int \left (a^2 \tan ^4(c+d x)+2 a b \sin (c+d x) \tan ^4(c+d x)+b^2 \sin ^2(c+d x) \tan ^4(c+d x)\right ) \, dx\\ &=a^2 \int \tan ^4(c+d x) \, dx+(2 a b) \int \sin (c+d x) \tan ^4(c+d x) \, dx+b^2 \int \sin ^2(c+d x) \tan ^4(c+d x) \, dx\\ &=\frac {a^2 \tan ^3(c+d x)}{3 d}-a^2 \int \tan ^2(c+d x) \, dx-\frac {(2 a b) \text {Subst}\left (\int \frac {\left (1-x^2\right )^2}{x^4} \, dx,x,\cos (c+d x)\right )}{d}+\frac {b^2 \text {Subst}\left (\int \frac {x^6}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac {a^2 \tan (c+d x)}{d}+\frac {a^2 \tan ^3(c+d x)}{3 d}-\frac {b^2 \sin ^2(c+d x) \tan ^3(c+d x)}{2 d}+a^2 \int 1 \, dx-\frac {(2 a b) \text {Subst}\left (\int \left (1+\frac {1}{x^4}-\frac {2}{x^2}\right ) \, dx,x,\cos (c+d x)\right )}{d}+\frac {\left (5 b^2\right ) \text {Subst}\left (\int \frac {x^4}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=a^2 x-\frac {2 a b \cos (c+d x)}{d}-\frac {4 a b \sec (c+d x)}{d}+\frac {2 a b \sec ^3(c+d x)}{3 d}-\frac {a^2 \tan (c+d x)}{d}+\frac {a^2 \tan ^3(c+d x)}{3 d}-\frac {b^2 \sin ^2(c+d x) \tan ^3(c+d x)}{2 d}+\frac {\left (5 b^2\right ) \text {Subst}\left (\int \left (-1+x^2+\frac {1}{1+x^2}\right ) \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=a^2 x-\frac {2 a b \cos (c+d x)}{d}-\frac {4 a b \sec (c+d x)}{d}+\frac {2 a b \sec ^3(c+d x)}{3 d}-\frac {a^2 \tan (c+d x)}{d}-\frac {5 b^2 \tan (c+d x)}{2 d}+\frac {a^2 \tan ^3(c+d x)}{3 d}+\frac {5 b^2 \tan ^3(c+d x)}{6 d}-\frac {b^2 \sin ^2(c+d x) \tan ^3(c+d x)}{2 d}+\frac {\left (5 b^2\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=a^2 x+\frac {5 b^2 x}{2}-\frac {2 a b \cos (c+d x)}{d}-\frac {4 a b \sec (c+d x)}{d}+\frac {2 a b \sec ^3(c+d x)}{3 d}-\frac {a^2 \tan (c+d x)}{d}-\frac {5 b^2 \tan (c+d x)}{2 d}+\frac {a^2 \tan ^3(c+d x)}{3 d}+\frac {5 b^2 \tan ^3(c+d x)}{6 d}-\frac {b^2 \sin ^2(c+d x) \tan ^3(c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.47, size = 176, normalized size = 1.18 \begin {gather*} -\frac {\sec ^3(c+d x) \left (200 a b-36 \left (2 a^2+5 b^2\right ) (c+d x) \cos (c+d x)+288 a b \cos (2 (c+d x))-24 a^2 c \cos (3 (c+d x))-60 b^2 c \cos (3 (c+d x))-24 a^2 d x \cos (3 (c+d x))-60 b^2 d x \cos (3 (c+d x))+24 a b \cos (4 (c+d x))+30 b^2 \sin (c+d x)+32 a^2 \sin (3 (c+d x))+65 b^2 \sin (3 (c+d x))+3 b^2 \sin (5 (c+d x))\right )}{96 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.22, size = 185, normalized size = 1.24
method | result | size |
derivativedivides | \(\frac {a^{2} \left (\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}-\tan \left (d x +c \right )+d x +c \right )+2 a b \left (\frac {\sin ^{6}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}-\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )+b^{2} \left (\frac {\sin ^{7}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {4 \left (\sin ^{7}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )}-\frac {4 \left (\sin ^{5}\left (d x +c \right )+\frac {5 \left (\sin ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \sin \left (d x +c \right )}{8}\right ) \cos \left (d x +c \right )}{3}+\frac {5 d x}{2}+\frac {5 c}{2}\right )}{d}\) | \(185\) |
default | \(\frac {a^{2} \left (\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}-\tan \left (d x +c \right )+d x +c \right )+2 a b \left (\frac {\sin ^{6}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}-\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )+b^{2} \left (\frac {\sin ^{7}\left (d x +c \right )}{3 \cos \left (d x +c \right )^{3}}-\frac {4 \left (\sin ^{7}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )}-\frac {4 \left (\sin ^{5}\left (d x +c \right )+\frac {5 \left (\sin ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \sin \left (d x +c \right )}{8}\right ) \cos \left (d x +c \right )}{3}+\frac {5 d x}{2}+\frac {5 c}{2}\right )}{d}\) | \(185\) |
risch | \(a^{2} x +\frac {5 b^{2} x}{2}+\frac {i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {a b \,{\mathrm e}^{i \left (d x +c \right )}}{d}-\frac {a b \,{\mathrm e}^{-i \left (d x +c \right )}}{d}-\frac {i b^{2} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}-\frac {2 \left (6 i a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+9 i b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+12 a b \,{\mathrm e}^{5 i \left (d x +c \right )}+6 i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+12 i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+16 a b \,{\mathrm e}^{3 i \left (d x +c \right )}+4 i a^{2}+7 i b^{2}+12 a \,{\mathrm e}^{i \left (d x +c \right )} b \right )}{3 d \left (1+{\mathrm e}^{2 i \left (d x +c \right )}\right )^{3}}\) | \(211\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.57, size = 119, normalized size = 0.80 \begin {gather*} \frac {2 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} a^{2} + {\left (2 \, \tan \left (d x + c\right )^{3} + 15 \, d x + 15 \, c - \frac {3 \, \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1} - 12 \, \tan \left (d x + c\right )\right )} b^{2} - 4 \, a b {\left (\frac {6 \, \cos \left (d x + c\right )^{2} - 1}{\cos \left (d x + c\right )^{3}} + 3 \, \cos \left (d x + c\right )\right )}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 118, normalized size = 0.79 \begin {gather*} \frac {3 \, {\left (2 \, a^{2} + 5 \, b^{2}\right )} d x \cos \left (d x + c\right )^{3} - 12 \, a b \cos \left (d x + c\right )^{4} - 24 \, a b \cos \left (d x + c\right )^{2} + 4 \, a b - {\left (3 \, b^{2} \cos \left (d x + c\right )^{4} + 2 \, {\left (4 \, a^{2} + 7 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - 2 \, b^{2}\right )} \sin \left (d x + c\right )}{6 \, d \cos \left (d x + c\right )^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \tan ^{4}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 10.04, size = 235, normalized size = 1.58 \begin {gather*} \frac {x\,\left (2\,a^2+5\,b^2\right )}{2}-\frac {\left (-2\,a^2-5\,b^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (\frac {8\,a^2}{3}+\frac {20\,b^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {28\,a^2}{3}+\frac {22\,b^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\frac {64\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{3}+\left (\frac {8\,a^2}{3}+\frac {20\,b^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\frac {32\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+\left (-2\,a^2-5\,b^2\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {32\,a\,b}{3}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________